package com.xiaocheng.core.abstractfactory.factory;

import com.xiaocheng.core.abstractfactory.interfaces.ColorOfCar;
import com.xiaocheng.core.abstractfactory.interfaces.Shape;
import com.xiaocheng.core.abstractfactory.interfaces.impl.Blue;
import com.xiaocheng.core.abstractfactory.interfaces.impl.Red;

public class ColorFactory extends CarFactory {

	@Override
	public ColorOfCar getColor(String color) throws Exception {
		ColorOfCar colorOfCar = null;
		switch (color) {
		case "red":
			colorOfCar = new Red();
			break;
		case "blue":
			colorOfCar = new Blue();
			break;
		default:
			colorOfCar = new Red();
			break;
		}
		return colorOfCar;
	}

	@Override
	public Shape getShape(String shape) throws Exception {

		return null;
	}

}
